package com.chapter10.static_.case_static;

public class static_childGame {
    public static void main(String[] args) {

        int count=0;

        Child mike = new Child("mike",19);
//        count++;
        mike.count++;
        mike.say();

        Child Amy = new Child("Amy",20);
//        count++;
        Amy.count++;
        Amy.say();

        Child Bob = new Child("Bob",21);
//        count++;
        Bob.count++;
        Bob.say();

        System.out.println(mike.count);
        System.out.println(Amy.count);
        System.out.println(Bob.count);

    }
}


class Child{
    private String name;
    private int age;
    public static int count = 0;

    public Child(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void say() {
        System.out.println(this.age + " " + this.name);
    }
}
